package com.lin;

import org.apache.commons.collections4.CollectionUtils;

// 满减促销
class FullReducePromotion implements Promotion {
    private double fullPrice;
    private double reducePrice;

    public FullReducePromotion(double fullPrice, double reducePrice) {
        this.fullPrice = fullPrice;
        this.reducePrice = reducePrice;
    }

    @Override
    public double calculateDiscount(Order order) {
        double total = order.getTotalPrice();

        if (total > fullPrice) {
            total = total - reducePrice;
        }
        return total;
    }
    }